home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
476-500
/
disk_481
/
wavemaker
/
utils.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-06
|
799b
|
43 lines
#include <exec/types.h>
/****************************************************************/
USHORT amptopot(amp)
/* Convert an amplitude to an integer to put in the proportional */
/* gadget's VertPot value. */
LONG amp;
{
USHORT temp;
temp = (127-abs(amp))<<9;
return(temp);
}
/****************************************************************/
LONG pottoamp(pot,potsign)
/* Converts a proportional gadget's VertPot value to an amplitude */
USHORT pot;
SHORT potsign;
{
LONG temp;
temp = (127-(pot>>9))*potsign;
return(temp);
}
/************************************************************/
LONG randamp()
/* Picks a random amplitude (for the game mode) */
{
LONG temp;
temp=(rand()&0xFF)-127;
if (temp==128) temp=127;
return(temp);
}